package com.ep.modules.app.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ep.common.utils.PageUtils;
import com.ep.modules.app.dao.AppAuditReportFormatMapper;
import com.ep.modules.app.entity.AppAuditReportFormat;
//import com.ep.modules.app.entity.AppAuditReportFormatExample;
import com.ep.modules.app.entity.AppAuditReportFormatWithBLOBs;
import com.ep.modules.app.service.AppAuditReportFormatService;
import java.util.List;
import java.util.Map;
//import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AppAuditReportFormatServiceImpl implements AppAuditReportFormatService {
    @Autowired
    private AppAuditReportFormatMapper appAuditReportFormatMapper;

    public PageUtils queryPage(Map<String, Object> params) {
        String searchKey = (String)params.get("searchKey");
        Long searchUserId = (Long)params.get("searchUserId");
//        AppAuditReportFormatExample example = new AppAuditReportFormatExample();
//        AppAuditReportFormatExample.Criteria criteria = example.createCriteria();
       // List<AppAuditReportFormat> list = appAuditReportFormatMapper.selectByExample(example);
        Page<AppAuditReportFormat> page = new Page<>();
        //page.setRecords(list);
        return new PageUtils(page);
    }

    public AppAuditReportFormat getById(Long id) {
        return appAuditReportFormatMapper.selectByPrimaryKey(id.intValue());
    }

    public void save(AppAuditReportFormat entity) {

        AppAuditReportFormatWithBLOBs record  =  new AppAuditReportFormatWithBLOBs();

        appAuditReportFormatMapper.insert(record);
    }

    public void update(AppAuditReportFormat entity) {

        AppAuditReportFormatWithBLOBs record  =  new AppAuditReportFormatWithBLOBs();

        appAuditReportFormatMapper.updateByPrimaryKeySelective(record);
    }

    public void deleteBatch(Long[] ids) {
        for (Long id : ids) {
                appAuditReportFormatMapper.deleteByPrimaryKey(id.intValue());
        }
    }
}